]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellTextureCache: Don't try to scale pixbuf to 0 size
authorColin Walters <walters@verbum.org>
Mon, 10 Aug 2009 01:42:41 +0000 (21:42 -0400)
committerColin Walters <walters@verbum.org>
Wed, 12 Aug 2009 19:56:43 +0000 (15:56 -0400)
If we pass in -1 for both width and height, we'd attempt
to scale the image to 0x0.  Don't do that; just avoid
scaling the pixbuf and let ClutterTexture do it for us.

src/shell-texture-cache.c

index 5e5c299e0b167962e05e2b8a81ae889bdd9ab111..90e1b2e16b65bd0876f30c761e9d593a39100a66 100644 (file)
@@ -210,7 +210,7 @@ compute_pixbuf_scale (gint      width,
     }
 
   // Scale the image only if that will not increase its original dimensions.
-  if (scaled_width >= 0 && scaled_height >= 0 && scaled_width < width && scaled_height < height)
+  if (scaled_width > 0 && scaled_height > 0 && scaled_width < width && scaled_height < height)
     {
       *new_width = scaled_width;
       *new_height = scaled_height;